package com.topvision.controller;

import com.topvision.feign.ProductFeign;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shengwm
 *
 */
@RestController
@Api(value = "订单产品服务", description = "服务产品的订单查询相关API ")
public class ProductResource {

    @Autowired
    private ProductFeign productFeign;

    @GetMapping("/product/list/{id}")
    @PreAuthorize("hasAuthority('DEMO')")
    public ResponseEntity products(@PathVariable Long id) {
        ResponseEntity responseEntity = this.productFeign.products();
        return responseEntity;
    }
}
